home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / programming / gcc / gcc2.7.0 / gcc270cp.lha / gnu / lib / g++-include / std / cstring.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.4 KB  |  66 lines

  1. // The -*- C++ -*- null-terminated string header.
  2. // This file is part of the GNU ANSI C++ Library.
  3.  
  4. #ifndef __CSTRING__
  5. #define __CSTRING__
  6.  
  7. // The ANSI C prototypes for these functions have a const argument type and
  8. // non-const return type, so we can't use them.
  9.  
  10. #define strchr  __hide_strchr
  11. #define strpbrk __hide_strpbrk
  12. #define strrchr __hide_strrchr
  13. #define strstr  __hide_strstr
  14. #define memchr  __hide_memchr
  15.  
  16. #include_next <string.h>
  17.  
  18. #undef strchr
  19. #undef strpbrk
  20. #undef strrchr
  21. #undef strstr
  22. #undef memchr
  23.  
  24. #include <std/cstddef.h>
  25.  
  26. #ifdef __GNUG__
  27. #pragma interface "std/cstring.h"
  28. #endif
  29.  
  30. extern "C" const char *strchr (const char *, int);
  31. inline char *
  32. strchr (char *s, int c)
  33. {
  34.   return (char*) strchr ((const char *) s, c);
  35. }
  36.  
  37. extern "C" const char *strpbrk (const char *, const char *);
  38. inline char *
  39. strpbrk (char *s1, const char *s2)
  40. {
  41.   return (char *) strpbrk ((const char *) s1, s2);
  42. }
  43.  
  44. extern "C" const char *strrchr (const char *, int);
  45. inline char *
  46. strrchr (char *s, int c)
  47. {
  48.   return (char *) strrchr ((const char *) s, c);
  49. }
  50.  
  51. extern "C" const char *strstr (const char *, const char *);
  52. inline char *
  53. strstr (char *s1, const char *s2)
  54. {
  55.   return (char *) strstr ((const char *) s1, s2);
  56. }
  57.  
  58. extern "C" const void *memchr (const void *, int, size_t);
  59. inline void *
  60. memchr (void *s, int c, size_t n)
  61. {
  62.   return (void *) memchr ((const void *) s, c, n);
  63. }
  64.  
  65. #endif
  66.